<?php
//无限分页
$arr = range(0, 10);
$opt['limit'] = $size =3;
$count = count($arr);
$pages = ceil($count/$size);

$pageN = 10;

for($page=1;$page<$pageN;$page++) {
	//$start = ($page%$pages - 1) * $size;
	$start = (($page-1)%$pages) * $size;
	$pageList[$page] = array_slice($arr, $start, $size);
} 


$res = [
    'count' => $count,// 总数
    'pages' => $pages, // 总页数
    'size' => $opt['limit'], // 每页条数
    'pageList' => $pageList, // 每页条数
];

print_r($res);

/*
$res['virtual_total'] = 500 < $page['count'] ? max($res['count'], mt_rand(300000, 10000000)) : $page['count'];
$res['virtual_pages'] = (int)ceil($res['virtual_total'] / $opt['limit']);
$res = [
    'count' => $res['virtual_total'] ?? 0,// 总数
    'pages' => $res['virtual_pages'] ?? 0, // 总页数
    'size' => $opt['limit'], // 每页条数
    'page' => $opt['page'], // 当前页码
    'rows' => $rows, // 数据
];*/